/*************************************************************************
Purpose:  This program computes FES's tidal periods, in hours. Output is
          designed to be copied directly to definitions.hpp
**************************************************************************    
Input: None. 
**************************************************************************    
Output: Writes C++ code which defines various tidal periods.
**************************************************************************      
Copyright 2010 Bryan Killett

This file is part of GAIA.

GAIA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

GAIA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GAIA. If not, see <http://www.gnu.org/licenses/>.
*************************************************************************/
//Header file "definitions.hpp" declares many functions, constants, datatypes.
//In order to use the functions declared in definitions.hpp, must link
//with object code that includes functions.cpp.
#include "definitions.hpp"

int main(){  

  /*
  //Tidal periods, in seconds.  Taken from FES source code file prediction.c.
  static const double m2_period =                12.420600891*3600.0;
  static const double m4_period =               m2_period/2.0;
  static const double k1_period =                23.934469223*3600.0;
  static const double s2_period =                12.000000000*3600.0;
  static const double o1_period =                25.819341660*3600.0;
  static const double p1_period =                24.065889359*3600.0;
  static const double n2_period =                12.658348083*3600.0;
  static const double two_n2_period =            12.904800000*3600.0;//Wunsch
  static const double k2_period =                11.967234612*3600.0;
  static const double msqm_period =             170.304000000*3600.0;//Wunsch
  static const double mtm_period =              219.120000000*3600.0;//Wunsch
  static const double mf_period =               327.859008789*3600.0;
  //From tide glossary (downloaded).
  static const double mm_period =               661.309204855*3600.0;
  static const double q1_period =                26.868356705*3600.0;
  //*/

  double freq;//as defined in prediction.c

  /* Q1 */
  freq =	(double)13.39866087990;
  cout<<"static const double q1_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* O1 */
  freq =	(double)13.94303558000;
  cout<<"static const double o1_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* K1 */
  freq =	(double)15.04106864000;
  cout<<"static const double k1_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* 2N2 */
  freq =	(double)27.89535481990;
  cout<<"static const double two_n2_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* N2 */
  freq =	(double)28.43972952010;
  cout<<"static const double n2_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* M2 */
  freq =	(double)28.98410422000;
  cout<<"static const double m2_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* K2 */
  freq =	(double)30.08213728000;
  cout<<"static const double k2_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* S2 */
  freq =	(double)30.00000000000;
  cout<<"static const double s2_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* P1 */
  freq =	(double)14.95893136000;
  cout<<"static const double p1_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* M4 */
  freq =	(double)57.96820840000;
  cout<<"static const double m4_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* S1 */
  freq =	(double)15.00000000000;
  cout<<"static const double s1_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* Mf */
  freq =	(double)1.098033100000;
  cout<<"static const double mf_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* Mm */
  freq =	(double)0.544374700000;
  cout<<"static const double mm_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* Mtm */
  freq =	(double)1.642407800000;
  cout<<"static const double mtm_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;
  /* MSqm */
  freq =	(double)2.113928800000;
  cout<<"static const double msqm_period =       "<<setiosflags(ios::fixed)<<setprecision(10)<<setw(16)<<((double)360.0)/freq<<"*3600.0;"<<endl;

  return 0;

}
